UnitTestException on failure.
1 import std.range : iota; 2 3 auto inOrder = iota(4); 4 auto noOrder = [2, 3, 0, 1]; 5 auto oops = [2, 3, 4, 5]; 6 7 inOrder.shouldBeSameSetAs(noOrder); 8 inOrder.shouldBeSameSetAs(oops).shouldThrow!UnitTestException; 9 10 struct Struct { 11 int i; 12 } 13 14 [Struct(1), Struct(4)].shouldBeSameSetAs([Struct(4), Struct(1)]);
Verify that t and u represent the same set (ordering is not important).